<?php
class Form_User_ChangePassword extends Zend_Form{
    public function init(){ 

        $mail = $this->createElement('hidden', 'mail', array('required' => true));
		
		$password = $this->createElement('password', 'password', array('label' => 'Hasło', 'required' => true));
		$password->addValidator(new Zend_Validate_StringLength(6, 120));

		$passwordC = $this->createElement('password', 'cpassword', array('label' => 'Potwierdź hasło', 'required' => true));
		$pass = Zend_Controller_Front::getInstance()->getRequest()->getParam('password', '');
		$passwordC->addValidator(new Zend_Validate_StringLength(6, 120))
				  ->addValidator('Identical', false, array($pass));

		$this->addElements(array($password, $passwordC, $mail));

		$this->addElement('submit', 'Zmień');
    }

}